const mongoose = require("mongoose");
const Schema = mongoose.Schema;

const articleSchema = new mongoose.Schema({
  //标题
  title: {
    type: String,
    required: [true, "you must tell us your  title"],
  },
  //时间
  time: {
    type: String,
    required: [true, "you must tell us your time"],
  },
  //图片列表
  imageList: {
    type: Array,
    default: [],
  },
  //文章类型  0普通文章  1总体要求 2组织架构 3工作方案
  type: {
    type: Number,
    required: [true, "you must tell us your type"],
  },
  //内容
  contents: {
    type: Array,
    required: [true, "you must tell us your contents"],
  },
});

const Artical = mongoose.model("Artical", articleSchema);
module.exports = Artical;
